function setCanvas(map) {
  let size = 40
  var canvas = document.createElement("canvas")
  canvas.width = size
  canvas.height = size
  var ctx = canvas.getContext("2d")
  var radius = size / 4
  var increase = true
  function draw() {
    ctx.clearRect(0, 0, size, size)
    /* 第一个圆 */
    ctx.beginPath()
    ctx.arc(size / 2, size / 2, radius, 0, Math.PI * 2)
    ctx.closePath()
    ctx.fillStyle = "#ff2d5166"
    ctx.fill()
    /* 第二个圆 */
    ctx.beginPath()
    ctx.arc(size / 2, size / 2, 8, 0, Math.PI * 2)
    ctx.closePath()
    ctx.fillStyle = "#0088ff"
    ctx.fill()
    if (radius > 14) {
      increase = false
    }
    if (radius < 10) {
      increase = true
    }
    if (increase) {
      radius++
    } else {
      radius--
    }
    setTimeout(draw, 180)
    map.render()
  }
  draw()
  return canvas
}

export { setCanvas }
